package com.yida.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.yida.bean.blog;
import com.yida.service.serverblog;


@Controller
public class search {

	@Autowired
	public serverblog service;
	
	@RequestMapping("/search")
	public String search(Model mode,String keyword) {
		
		//热门博客
     	List<blog> blogre = service.selectblogreservice();
        //关键字
		List<com.yida.bean.blog> blog = service.searchservice(keyword);
		
	    mode.addAttribute("bloglist", blog);
	    mode.addAttribute("bloglistre", blogre);
	    
		return "search";
	}
	}
